import axios from 'axios';
import { showNotify } from 'vant'


// 配置各个公共项
// axios.defaults.baseURL = "/api/"
axios.defaults.timeout = 50000;
axios.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded";

axios.interceptors.request.use(function (config) {
    return config
})

axios.interceptors.response.use(function (response) {

    showNotify({
        type: response.data.code === '200' ? "success" : "danger",
        message: response.data.message
    })

    return response
})

export default axios;

